#ifndef ROSTERMODEL_H
#define ROSTERMODEL_H

#include <QAbstractItemModel>
#include <QStringList>
#include <QSet>

#include "yalb_abstracttreemodel.h"

class ColumnHeader;
class RosterElement;

class RosterModel : public yALB_AbstractTreeModel
{
    Q_OBJECT

    friend class Roster;
public:
    RosterModel(yALB_AbstractTreeItem *rootItem, ColumnHeader *_header, QObject *parent = 0);

    QVariant data(const QModelIndex &index, int role) const;
    QVariant headerData(int section, Qt::Orientation orientation,
                        int role = Qt::DisplayRole) const;
    int columnCount(const QModelIndex &parent = QModelIndex()) const;

    void emitDataChanged(RosterElement *element);
    RosterElement* getElementFromIndex(const QModelIndex &index);

signals:

private slots:
    void onColumnAboutToBeInserted();
    void onColumnInserted();
    void onColumnsAboutToBeCleared();
    void onColumnsCleared();

private:
    ColumnHeader *header;
};

#endif // ROSTERMODEL_H
